<%@ page import="java.util.List"%>
<%@ page import="model.MovieSection"%>
<% if (session.getAttribute("listMovieSection") != null)
{
	List<MovieSection> listMovieSection = (List<MovieSection>) session.getAttribute("listMovieSection");
 	if (listMovieSection.size()!=0)
	{%>
<div class="Mt">
    <div class="title">
        <h3>Search Result</h3>
    </div>
    <div class="clr"></div>
    <table id="movieTable">
        <thead>
            <tr>
                <th>Movie Name</th>
                <th>Price</th>
                <th>Start Time</th>
                <th>Duration</th>
                <th>House</th>
                <th>Action</th>
            </tr>
        </thead>
        <tbody>
            <%
                 
                 for (MovieSection movieSection : listMovieSection) {
                     pageContext.setAttribute("curr_movieSection", movieSection);
            %>
            <tr>
                <td>${curr_movieSection.movieName}</td>
                <td>${curr_movieSection.price}</td>
                <td>${curr_movieSection.startTimeString}</td>
                <td>${curr_movieSection.duration}</td>
                <td>${curr_movieSection.houseId}</td>
                <td><a
                        href="<%=request.getAttribute("purchaseURL")%>?id=${curr_movieSection.id}">Purchase</a>
                </td>
            </tr>
            <%}%>
        </tbody>
    </table>
</div>
<%
                session.setAttribute("listMovieSection", null);
	}       
	}
%>